

#被动技能【弹夹】
#更改伤害与直线射击
execute as @e[type=#arrows,nbt={PierceLevel:12b}] run data merge entity @s {NoGravity:1b,damage:1d}
#限制射击距离
kill @e[type=#arrows,nbt={PierceLevel:12b},scores={skTimeKe=10..}]
execute as @a[tag=laiwei,scores={skCrossBow0=1..,skPlayer=0..}] at @s run function nw:yingxiong/1yingxiong/04tezhongbing/skill/zhuangdan
scoreboard players set @a[tag=laiwei,scores={skSneak=1..}] skSneak 0


#被动技能【弹夹】自动换弹
execute as @a[tag=laiwei,scores={skCDJPG=..0}] run function nw:yingxiong/1yingxiong/04tezhongbing/skill/1zidonghuandan
#被动技能【弹夹】
execute as @a[tag=laiwei,scores={skPlayer=1}] at @s run function nw:yingxiong/1yingxiong/04tezhongbing/skill/0huandantishi
#被动技能【满弹夹备战】手动换弹
execute as @a[tag=laiwei,scores={skPlayer=3..8}] if data entity @s Inventory[{Slot:-106b,id:"minecraft:crossbow",Count:1b}] run function nw:yingxiong/1yingxiong/04tezhongbing/skill/1shoudonghuandan

#主动技能【快速换弹】
execute as @a[tag=laiwei,scores={skJPG=1..}] run function nw:yingxiong/1yingxiong/04tezhongbing/skill/danxia

#主动技能【战术详攻】
execute as @a[tag=laiwei,scores={skEXBottle=1}] run function nw:yingxiong/1yingxiong/04tezhongbing/skill/jinengping
#主动技能【战术详攻】二段：【广域破片榴弹】
execute as @a[tag=laiwei,scores={skEXBottle=3}] at @s run function nw:yingxiong/1yingxiong/04tezhongbing/skill/shoulei1
#主动技能【战术详攻】二段：【高核闪光弹】
execute as @a[tag=laiwei,scores={skEXBottle=2,skEgg=1..}] at @s run function nw:yingxiong/1yingxiong/04tezhongbing/skill/shoulei2
#主动技能【战术详攻】二段：【特质压缩烟雾弹】
execute as @a[tag=laiwei,scores={skEXBottle=2,skSnowball=1..}] at @s run function nw:yingxiong/1yingxiong/04tezhongbing/skill/shoulei3
#主动技能【战术详攻】技能CD
execute as @a[tag=laiwei,scores={skCDEXBottle=0}] run function nw:yingxiong/1yingxiong/04tezhongbing/skill/jinengcd

#【特质压缩烟雾弹】效果
execute if entity @a[tag=BossAlready] as @e[type=armor_stand,tag=smoke] at @s run effect give @a[team=VSBOSS,distance=..7] speed 2 0 true
execute if entity @a[tag=BossAlready] as @e[type=armor_stand,tag=smoke] at @s run effect give @a[team=VSBOSS,distance=..7] invisibility 2 0 true

execute unless entity @a[tag=BossAlready] at @e[type=armor_stand,tag=smoke] run effect give @a[distance=0..7,tag=!laiwei] glowing 2 0 true
execute at @e[type=armor_stand,tag=smoke] run effect give @a[distance=0..7,tag=laiwei] speed 2 0 true
execute at @e[type=armor_stand,tag=smoke] run effect give @a[distance=0..7,tag=laiwei] invisibility 2 0 true

#【特质压缩烟雾弹】中心特效
execute at @e[type=armor_stand,tag=smoke,scores={skCDEntity=2}] run particle campfire_cosy_smoke ~ ~ ~ 2.4 1.2 2.4 0.01 40 normal @a
execute at @e[type=armor_stand,tag=smoke,scores={skCDEntity=2}] run particle campfire_cosy_smoke ~ ~ ~ 1.7 0.7 1.7 0.01 80 normal @a
execute at @e[type=armor_stand,tag=smoke,scores={skCDEntity=5}] run particle campfire_cosy_smoke ~ ~ ~ 2.4 1.2 2.4 0.01 40 normal @a
execute at @e[type=armor_stand,tag=smoke,scores={skCDEntity=5}] run particle campfire_cosy_smoke ~ ~ ~ 1.7 0.7 1.7 0.01 80 normal @a

#【特质压缩烟雾弹】边缘特效
execute as @e[type=minecraft:armor_stand,tag=smoke] at @s run tp @s ~ ~ ~ ~10 ~
execute as @e[type=minecraft:armor_stand,tag=smoke] at @s rotated ~ 0 positioned ^ ^-0.7 ^6.5 run particle campfire_cosy_smoke ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a
execute as @e[type=minecraft:armor_stand,tag=smoke] at @s run tp @s ~ ~ ~ ~10 ~
execute as @e[type=minecraft:armor_stand,tag=smoke] at @s rotated ~ 0 positioned ^ ^-0.7 ^6.5 run particle campfire_cosy_smoke ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a
execute as @e[type=minecraft:armor_stand,tag=smoke] at @s run tp @s ~ ~ ~ ~10 ~
execute as @e[type=minecraft:armor_stand,tag=smoke] at @s rotated ~ 0 positioned ^ ^-0.7 ^6.5 run particle campfire_cosy_smoke ~ ~ ~ 0.1 0.1 0.1 0.01 1 normal @a
#【特质压缩烟雾弹】结束
kill @e[type=armor_stand,tag=smoke,scores={skCDEntity=8..}]

execute as @a[tag=laiwei] run title @s actionbar [{"text":"战术佯攻","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEXBottle","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 弹匣","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"剩余：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skPlayer","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"发","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 正在换弹：","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDJPG","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]